
.PHONY: demo_saf_mmesp_project

all: demo_saf_mmesp_project

# common resources

R:=$(shell pwd)

CONFIG_OSAPI_POSIX=y
CONFIG_OS_LINUX=y
CONFIG_ARCH_IA32=y
CONFIG_MP_UNDEFINED=y
CONFIG_BOARD_UNDEFINED=y

MSRC:=$(wildcard $R/main/demo_saf_mmesp_project_demo/demo_saf_mmesp_project.c)
ifeq ($(MSRC), )
MSRC:=$(wildcard $R/main/demo_saf_mmesp_project_demo/demo_saf_mmesp_project.cpp)
endif

include $R/swresources/sgi_link_layer_swr/defs.mk
include $R/swresources/stdio_swr/defs.mk
include $R/swresources/stdlib_swr/defs.mk
include $R/swresources/string_swr/defs.mk
include $R/swresources/debug_primitives_swr/defs.mk
include $R/swresources/basic_types_swr/defs.mk
include $R/swresources/crc_16_swr/defs.mk
include $R/swresources/packmemmanagerpackalloc_swr/defs.mk
include $R/swresources/packmemmanager_swr/defs.mk
include $R/swresources/caemuplanner_swr/defs.mk
include $R/swresources/casgi_swr/defs.mk
include $R/swresources/caemugs_swr/defs.mk
include $R/swresources/cdburst_swr/defs.mk
include $R/swresources/cddataburst_swr/defs.mk
include $R/swresources/cdtmtccommserver_swr/defs.mk
include $R/swresources/cdcommconfig_swr/defs.mk
include $R/swresources/edroombp_swr/defs.mk
include $R/swresources/edroomsl_swr/defs.mk
include $R/swresources/edroom_glue_swr/defs.mk
include $R/swresources/ssi_link_layer_swr/defs.mk
include $R/swresources/casensordemo_swr/defs.mk
include $R/swresources/cassi_swr/defs.mk
include $R/swresources/caemutmtcserver_swr/defs.mk
include $R/swresources/cdframe_swr/defs.mk
include $R/swresources/cdsignal_swr/defs.mk
include $R/swresources/ut_base_swr/defs.mk
include $R/swresources/demo_saf_swr/defs.mk
include $R/swresources/demo_saf_it_swr/defs.mk
include $R/swresources/ut_manager_swr/defs.mk

include $R/osswresources/linux_osswr/defs.mk

CPPFLAGS+=-I $R/config/include

OBJS:=$(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(patsubst %.S, %.o, $(SRCS))))

MOBJ:=$(patsubst %.cpp,%.o, $(patsubst %.c,%.o,$(MSRC)))

# dependency files
DEPS:=$(patsubst %.o,%.d,$(OBJS)) $(patsubst %.o,%.d,$(MOBJ))

# compilation targets
TARGET:=$(patsubst %.o,%,$(MOBJ))

include $R/platformbundles/posix_linux_ia32_any_any/defs.mk

clean:
	@rm -f $(TARGET)
	@rm -f $(OBJS) $(MOBJ)
	@rm -f $(DEPS)
	@echo Cleaning done.

distclean : clean
	@find . -name '*.d' -exec rm -f "{}" \;
	@echo Mr. Proper done.

demo_saf_mmesp_project : $(ALT_TARGETS) $(TARGET)
